<div id="content_body" class="content_body">
	<div class="main-title">
		<fly:variable name="titre" />
	</div>
	<div class="content_header">
		<fly:block name="precedent">
		    <div style="float: left;">
		        <a href="<fly:variable name='language_folder'/><fly:variable name='url_precedent' />"><fly:translate name="text_previous_message" /></a><fly:modify name="text_previous_message" />
		    </div>
		</fly:block>
		<fly:block name="suivant">
		    <div style="float: right;">
		        <a href="<fly:variable name='language_folder'/><fly:variable name='url_suivant' />"><fly:translate name="text_next_message" /></a><fly:modify name="text_next_message" />
		    </div>
		</fly:block>
		<div style="margin: auto; text-align: center; width: 400px;">
		    <a href="<fly:variable name='language_folder' />/profil-message.php"><fly:translate name="text_back_message" /></a><fly:modify name="text_back_message" />
		</div>
	</div>

	<div style="clear: both"></div>
	<div id="message-body">
		<table class="recette-liste">
 				<col />
			    <col style="width: 397px;border-left:1px solid #FFFFFF;" />
		    <thead>
		        <tr>
           			<td><fly:translate name="text_author" /><fly:modify name="text_author" /></td>
           			<td><fly:translate name="text_message" /><fly:modify name="text_message" /></td>
      			</tr>
   			</thead>
	    	<tbody id="discussion">
		        <fly:list name="list_message">
			        <tr>
			            <td>
			                <fly:variable name="date" /><br />
							<fly:variable name="auteur" />
			            </td>
			            <td><fly:variable name="message" /></td>
			        </tr>			        
	        	</fly:list>
	    	</tbody>
		</table>
	</div>
	<br />
	<center id="button_center">
		<input type="button" value="<fly:translate name="botton_reply" />" name="repondre"  class="button" /><fly:modify name="botton_reply" />
	</center>
	<div id="frm_message">
		<form method="post" action="<fly:variable name='language_folder' />/profil-message-repondre.php" id="repondre">
		    <div id="form-ligne">	
				<div id="form-titre"><fly:translate name="text_message" /><fly:modify name="text_message" /></div>
				<div id="form-field">	   
		        	<textarea name="message" id="message" cols="60" rows="10" class="textarea"></textarea>
		        </div>
		    </div>
		   <div id="form-ligne">	
				<div id="form-titre">&nbsp;</div>
				<div id="form-field">
		        	<input type="submit" name="submit" value="<fly:translate name="botton_reply" />" class="submit" />		
		    	</div>
		    </div>
		    <input type="hidden" name="id" value="<fly:variable name='id_discussion' />" />
		</form>
	</div>
</div>
<script type="text/javascript">
    function autogrow_textarea(obj) {
        var padding = 20;
        var shadow_div_id = 'shadow_'+obj.id;
        var $shadow_div = $('#'+shadow_div_id);
        if($shadow_div.length == 0) {
            $shadow_div = $('<div id="'+shadow_div_id+'"></div>');
            $shadow_div.css({
                position: 'absolute',
                left: '-10000px',
                top: '-10000px',
                fontSize: $(obj).css('fontSize'),
                width: parseInt(obj.clientWidth-8)+'px'
            });
            obj.setAttribute('startHeight',obj.clientHeight);
            $(obj).after($shadow_div);
        }
        
        var clientHeight = obj.clientHeight;
        var shadowHeight = $shadow_div.get(0).clientHeight;
        var to_height;
        var startHeight = obj.getAttribute('startHeight');
        if(shadowHeight < startHeight) {
            to_height = startHeight;
        }
        else {
            to_height = shadowHeight+padding;
        }
        if(to_height && to_height != clientHeight) {
            $(obj).css('height', to_height+'px');
        }
    }
    
    $(document).ready(function() {
        $('#message').keyup(function() {
            autogrow_textarea(this);
        });
        $('#frm_message').hide();
        $('.button').click(function() {
			$("#button_center").hide();
        	$('#frm_message').slideDown("slow");
        });
    });
</script>
